using System;
using Microsoft.Xna.Framework.Input;

namespace SolarWinds.Input
{
    public class KeyEvent : InputEvent
    {
        private readonly Keys mKey;

        #region Properties

        public Keys Key
        {
            get { return mKey; }
        }

        #endregion

        public KeyEvent(TimeSpan time, InputModifiers modifiers, Keys key)
            : base(time, modifiers)
        {
            mKey = key;
        }

        public override string ToString()
        {
            return base.ToString() + "{Key:" + mKey + "}";
        }
    }

    public class KeyEventUnbuffered : InputEvent
    {
        private KeyboardState mKeyState;
        private readonly TimeSpan mElapsedTime;

        #region Properties

        public KeyboardState KeyState
        {
            get { return mKeyState; }
        }

        public TimeSpan ElapsedTime
        {
            get { return mElapsedTime; }
        }

        #endregion

        public KeyEventUnbuffered(TimeSpan time, TimeSpan elapsedTime, InputModifiers modifiers, KeyboardState keyState)
            : base(time, modifiers)
        {
            mElapsedTime = elapsedTime;
            mKeyState = keyState;
        }

        public override string ToString()
        {
            return base.ToString() + "{Key:" + mKeyState + "}";
        }
    }
}